package fun.easycode.webterminal.common.util;

import com.alibaba.ttl.TransmittableThreadLocal;

public final class TraceIdUtil {
    private static final TransmittableThreadLocal<String> TRACE_ID_THREAD_LOCAL = new TransmittableThreadLocal<>();

    public static String getTraceId() {
        return TRACE_ID_THREAD_LOCAL.get();
    }

    public static void setTraceId(String traceId) {
        TRACE_ID_THREAD_LOCAL.set(traceId);
    }

    public static void removeTraceId() {
        TRACE_ID_THREAD_LOCAL.remove();
    }
}
